﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SCRUM.Core.BusinessObjects;

namespace SCRUM.Core.DAO
{
	/// <summary>
	/// Data access object for user settings
	/// </summary>
	public static class DAOUserSettings
	{
		/// <summary>
		/// Gets the settings for logged user.
		/// </summary>
		/// <returns></returns>
		public static UserSettings GetSettingsForLoggedUser()
		{
			return DataProviders.ProviderFactory.Provider.GetSettingsForUser(DAOUser.GetLoggedUser().ID);
		}

		/// <summary>
		/// Updates the settings for logged user.
		/// </summary>
		/// <param name="us">The user settings.</param>
		public static void UpdateSettingsForLoggedUser(UserSettings us)
		{
			DataProviders.ProviderFactory.Provider.UpdateSettingsForLoggedUser(DAOUser.GetLoggedUser().ID, us);
		}

		/// <summary>
		/// Creates the default settings.
		/// </summary>
		public static void CreateDefaultSettings()
		{
			CreateDefaultSettings(DAOUser.GetLoggedUser().ID);
		}

		/// <summary>
		/// Creates the default settings.
		/// </summary>
		/// <param name="userID">The user ID.</param>
		public static void CreateDefaultSettings(int userID)
		{
			DataProviders.ProviderFactory.Provider.CreateDefaultSettings(userID);
		}

        public static UserSettings GetSettingsForUser(int userID)
        {
            return DataProviders.ProviderFactory.Provider.GetSettingsForUser(userID);
        }
    }
}
